﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Form.Master" Inherits="System.Web.Mvc.ViewPage<PostOuterInfoModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
	<h2>
		导入随笔</h2>
	<hr class="top-seperator" />
	<% using (Html.BeginForm()) %>
	<% { %>
	<fieldset>
		<legend>用户信息</legend>
		<p>
			<%= Html.LabelFor(c => c.OriginalUrl)%>
			<%= Html.TextBoxFor(c => c.OriginalUrl) %>
		</p>
		<p>
			<%= Html.LabelFor(c => c.CategoryID)%>
			<%= Html.DropDownTreeFor(c => c.CategoryID, new DropDownTreeSetting { url="/Post/GetCategories", width= 207})%>
		</p>
		<p>
			<%= Html.LabelFor(c => c.Description)%>
			<%= Html.TextBoxFor(c => c.Description)%>
		</p>
		<p>
			<%= Html.LabelFor(c => c.Remarks)%>
			<%= Html.TextAreaFor(c => c.Remarks, 5, 50, null )%>
		</p>
		<p>
			<%= Html.LabelFor(c => c.Status)%>
			<%= Html.DropDownListFor(c => c.Status, "StatusSource")%>
		</p>
	</fieldset>
	<div class="buttons action-buttons">
		<a class="btn large-action-btn"><span><input class="" name="commit" type="submit" />提 交</span></a>
	</div>
	<%} %>

	<script type="text/javascript">
		$(document).ready(function() {
			$("form").validate({
				rules: {
					OriginalUrl: "required",
					CategoryID: "required",
					Status: "required"
				},
				submitHandler: function(form) {
					$.getJSON('/OuterLink/Import/?type=rss', $('form').serialize(), function(data) {
						if (data.success) {
							alert("导入随笔成功!");
							//window.location = '/Home/Index';
						}
						else {
							alert(data.message);
						}
					});
				}
			});

		});
	</script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
	<script src="../../Content/js/jquery/plugins/dropdowntree/ui.core.js" type="text/javascript"></script> 

	<link href="../../Content/js/jquery/plugins/dropdowntree/dropdowntree.css" rel="stylesheet" type="text/css" />

	<script src="../../Content/js/jquery/plugins/dropdowntree/dropdowntree.js" type="text/javascript"></script>
	
	<script src="../../Content/js/jquery/plugins/jstree/_lib/jquery.cookie.js" type="text/javascript"></script>

	<script src="../../Content/js/jquery/plugins/jstree/_lib/jquery.hotkeys.js" type="text/javascript"></script>

	<script src="../../Content/js/jquery/plugins/jstree/jquery.jstree.js" type="text/javascript"></script>
</asp:Content>
